package com.yingsheng.bi.hks.web.controller;

import com.yingsheng.bi.hks.dto.Stores.*;
import com.yingsheng.bi.hks.dto.storedetail.*;
import com.yingsheng.bi.hks.feign.client.StoresFeignClient;
import com.yingsheng.bi.hks.service.stores.StoresMgmtService;
import com.yingsheng.bi.hks.service.storesdetail.StoresDetailMgmtService;
import com.yingsheng.bi.hks.template.annotation.Template;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RestController;

/**
 * 门店信息维护
 */
@RestController
public class StoresCtrl implements StoresFeignClient {

    @Autowired
    private StoresMgmtService storesMgmtService;
    @Autowired
    private StoresDetailMgmtService storesDetailMgmtService;

    @Template(name = "accessTransTemplate")
    @Override
    public StoresAddRes add(@Validated StoresAddReq req) {
        return storesMgmtService.add(req);
    }

    @Template(name = "accessTransTemplate")
    @Override
    public StoresModRes mod(@Validated StoresModReq req) {
        return storesMgmtService.mod(req);
    }

    @Template(name = "accessQueryTemplate")
    @Override
    public StoresQryRes qry(@Validated StoresQryReq req) {
        return storesMgmtService.qry(req);
    }

    @Template(name = "accessTransTemplate")
    @Override
    public StoresDelRes del(@Validated StoresDelReq req) {
        return storesMgmtService.del(req);
    }

    @Template(name = "accessTransTemplate")
    @Override
    public StoresDetailAddRes add(@Validated StoresDetailAddReq req) {
        return storesDetailMgmtService.add(req);
    }

    @Template(name = "accessTransTemplate")
    @Override
    public StoresDetailModRes mod(@Validated StoresDetailModReq req) {
        return storesDetailMgmtService.mod(req);
    }

    @Template(name = "accessQueryTemplate")
    @Override
    public StoresDetailQryRes qry(@Validated StoresDetailQryReq req) {
        return storesDetailMgmtService.qry(req);
    }

    @Template(name = "accessTransTemplate")
    @Override
    public StoresDetailDelRes del(@Validated StoresDetailDelReq req) {
        return storesDetailMgmtService.del(req);
    }
}
